import request from '@/utils/request';

/** 查询预付款列表 */
export const getAdvanceChargeListApi = (data: any) => {
    return request({
        url: '/system/advanceCharge/list',
        method: 'post',
        data: data
    });
};

/** 新增预付款充值记录 */

export const addAdvanceChargeApi = (data: any) => {
    return request({
        url: '/system/advanceChargeRecord',
        method: 'post',
        data: data
    });
};

/** 根据公司id获取客户列表 */
export const getCustomerListByCompanyIdApi = (id: any) => {
    return request({
        url: '/system/customerInfo/getCustomerByCompanyId',
        method: 'get',
        params: { id }
    });
};

/** 根据预付款编号查询充值信息详情 */
export const getAdvanceChargeRecordApi = (id: any) => {
    return request({
        url: '/system/advanceChargeRecord/advanceChargeDetail',
        method: 'get',
        params: { id }
    });
};

/** 新增预付款退款申请 */
export const addAdvanceChargeRefundApplyApi = (data: any) => {
    return request({
        url: '/system/advanceChargeRefundApply',
        method: 'post',
        data: data
    });
};

/** 获取预付款退款申请列表 */
export const getAdvanceChargeRefundApplyListApi = (id: any) => {
    return request({
        url: '/system/advanceChargeRefundApply/getApplyList',
        method: 'get',
        params: { id }
    });
};

/** 新增预付款退款记录 */
export const addAdvanceChargeRefundRecordApi = (data: any) => {
    return request({
        url: '/system/advanceChargeRefundRecord',
        method: 'post',
        data: data
    });
};

/** 删除预付款退款申请 */
export const deleteAdvanceChargeRefundApplyApi = (id: any) => {
    return request({
        url: `/system/advanceChargeRefundApply/${id}`,
        method: 'delete',
    });
};

/** 删除预付款 */
export const deleteAdvanceChargeApi = (id: any) => {
    return request({
        url: `/system/advanceCharge/${id}`,
        method: 'delete'
    });
};